<template>
  <div class="error-page">
    <div class="error-content">
      <div class="error-code">403</div>
      <div class="error-title">访问被拒绝</div>
      <div class="error-description">
        抱歉，您没有权限访问此页面。请联系管理员获取相应权限。
      </div>
      <div class="error-actions">
        <el-button type="primary" @click="goBack">返回上一页</el-button>
        <el-button @click="goHome">回到首页</el-button>
      </div>
    </div>
    <div class="error-image">
      <svg viewBox="0 0 404 404" xmlns="http://www.w3.org/2000/svg">
        <defs>
          <linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
            <stop offset="0%" style="stop-color:#409eff;stop-opacity:1" />
            <stop offset="100%" style="stop-color:#67c23a;stop-opacity:1" />
          </linearGradient>
        </defs>
        <circle cx="202" cy="202" r="200" fill="url(#grad1)" opacity="0.1"/>
        <path d="M202 50 L354 202 L202 354 L50 202 Z" fill="url(#grad1)" opacity="0.3"/>
        <text x="202" y="220" text-anchor="middle" font-size="120" font-weight="bold" fill="#f56c6c">!</text>
      </svg>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  router.go(-1)
}

const goHome = () => {
  router.push('/dashboard')
}
</script>

<style lang="scss" scoped>
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.error-content {
  text-align: center;
  max-width: 500px;
  margin-right: 50px;
}

.error-code {
  font-size: 120px;
  font-weight: bold;
  color: #f56c6c;
  line-height: 1;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.error-title {
  font-size: 32px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 16px;
}

.error-description {
  font-size: 16px;
  color: #606266;
  line-height: 1.6;
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.error-image {
  width: 400px;
  height: 400px;
  
  svg {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 768px) {
  .error-page {
    flex-direction: column;
    text-align: center;
  }
  
  .error-content {
    margin-right: 0;
    margin-bottom: 30px;
  }
  
  .error-code {
    font-size: 80px;
  }
  
  .error-title {
    font-size: 24px;
  }
  
  .error-image {
    width: 300px;
    height: 300px;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
    
    .el-button {
      width: 200px;
    }
  }
}
</style>
